package program;
public class Track {

	private Station stationA;
	private Station stationB;
	
	private float length;
	private int aveTravelTimeMins;
	private boolean inUse;
	
	public Track(Station a, Station b, float len, int aveTimeMins, boolean use) {
		
		if (a == null || b == null) throw new IllegalArgumentException("Cannot have null parameter");
		if (len <= 0 || aveTimeMins <= 0) throw new IllegalArgumentException("Parameter cannot be 0 or have negative value");
		
		stationA = a;
		a.addTrack(this);
		stationB = b;
		b.addTrack(this);
		length = len;
		aveTravelTimeMins = aveTimeMins;
		inUse = use;
	}

	//get length of track
	public float getLength(){
		return length;
	}
	
	//get in use status of track
	public boolean getInUse(){
		return inUse;
	}
	
	//get station A connected to track
	public Station getStationA(){
		return stationA;
	}

	//get station B connected to track
	public Station getStationB(){
		return stationB;
	}
	
	//get average travel time of a track
	public int getaveTravelTime(){
		return aveTravelTimeMins;
	}
	
	//Set inUse value of track
	public void setInUse(boolean InUse){
		inUse = InUse;
	}
	
	
	
}